Port

A port can be considered of as a "virtual slot" for TCP or UDP protocols that is used to map a connection between 2 hosts. Ports are numbered from 0 to 65535, with the range 1 to 1023 commonly referred to as "priviledged", and the range 1024 to 65535 as "dynamic". There are basically two uses for ports:

  1. listening on a port û used by server applications waiting for users to connect to a well-known service i.e. HTTP (TCP port 80), POP3 (TCP port 110) or DNS (UDP port 53)
  2. opening a dynamic port û both sides of a TCP connection need to be identified by IP addresses and port numbers. Therefore, when you want to connect to a server, your end of the communications channel also needs a port. This is done by choosing a port above 1024 on your computer that is not currently in use by another communication channel, and using it as the sending port in the new connection. Dynamic ports may also be used as "listening" ports in some applications, such as FTP.

Ports in the range 0-1023 are almost always server ports. Ports in the range 1024-65535 are usually ports that are opened dynamically when you connect to a server port. However, any port may be used as a server port, and any port may be used as an outgoing port.